-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
interp: pass TyCtxt to Machine methods that do not take InterpCx #95693
Conversation
Some changes occured to the CTFE / Miri engine cc @rust-lang/miri |
Uh... without miri or CTFE needing it, I think we should not add it. The only thing this gains us is changing the body of such a function to use tcx in CTFE without having to bump miri. |
It also gains us being able to start using I thought it might be needed for rust-lang/miri#2030 but @saethlin might know better; maybe having access to the |
Ah ok, well, experiments on the miri side is enough motivation for me, that just wasn't obvious to me @bors r+ rollup |
📌 Commit fcdfc3e has been approved by |
It occurred to me when I finished my first pass at rust-lang/miri#2030 that Stacked Borrows errors in that PR are substantially more helpful than a use-after-free error. I looked at what would be required to do the similar sort of thing for use after free, and it wasn't clear to me that the required context was available at the site where the error was being discovered in order to craft the better diagnostic. I don't know if this PR helps that situation, just some thoughts. |
Rollup of 4 pull requests Successful merges: - rust-lang#95659 (Rely on #[link] attribute for unwind on Fuchsia.) - rust-lang#95684 (rustdoc: Fix item info display overflow) - rust-lang#95693 (interp: pass TyCtxt to Machine methods that do not take InterpCx) - rust-lang#95699 (fix: Vec leak when capacity is 0) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
This just seems like something you might need, so let's consistently have it.
One day we might have to add
ParamEnv
as well, though that seems less likely (and in Miri you can always usereveal_all
anyway). It might make sense to have a type that packagesTyCtxt
andParamEnv
, this pairing occurs quite frequently in rustc...r? @oli-obk